﻿<phone:PhoneApplicationPage 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
	xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
	x:Class="TourGuideApp.ToursListPage"
	FontFamily="{StaticResource PhoneFontFamilyNormal}"
	FontSize="{StaticResource PhoneFontSizeNormal}"
	Foreground="{StaticResource PhoneForegroundBrush}"
	Orientation="Portrait"
	shell:SystemTray.IsVisible="True">
	<phone:PhoneApplicationPage.Resources>
		<DataTemplate x:Key="tourTemplate">
			<Grid HorizontalAlignment="Left" Height="256" VerticalAlignment="Top" Width="462">
				<StackPanel Orientation="Horizontal" Width="458" Margin="2,0" Height="57" VerticalAlignment="Top">
					<Image Name="thumbNailImage" Source="{Binding ThumbNailURI}"  Width="100"  Margin="0,7,0,-21" />
					<TextBlock Text="{Binding title}" TextWrapping="Wrap" VerticalAlignment="Top" Width="323" Height="49" HorizontalAlignment="Left"/>
					<Grid Margin="0,11,0,0" Width="27" Height="29" VerticalAlignment="Top">
						<Ellipse Fill="{StaticResource PhoneAccentBrush}" Stroke="{StaticResource PhoneAccentBrush}" RenderTransformOrigin="0.462,0.714" Margin="0,0,-1,0"/>
						<TextBlock Text="{Binding language}" Margin="3,-2,1,2" HorizontalAlignment="Center" VerticalAlignment="Center"/>
					</Grid>
				</StackPanel>
				<TextBlock Text="{Binding author}" TextWrapping="Wrap" Style="{StaticResource PhoneTextAccentStyle}" Height="30" HorizontalAlignment="Left" Margin="104,56,0,0" Width="343" FontSize="12" VerticalAlignment="Top"/>
				<TextBlock Text="{Binding description}" TextWrapping="Wrap" Style="{StaticResource PhoneTextSmallStyle}" Margin="11,87,16,29"/>
			</Grid>
		</DataTemplate>
	</phone:PhoneApplicationPage.Resources>

	<!--LayoutRoot is the root grid where all page content is placed-->
	<Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{Binding Source={StaticResource TourSampleDataSource}}">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		
		<!--TitlePanel contains the name of the application and page title-->
		<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
			<TextBlock x:Name="ApplicationTitle" Text="{StaticResource AppName}" Style="{StaticResource PhoneTextNormalStyle}"/>
		</StackPanel>

		<!--ContentPanel - place additional content here-->
		<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
			<ListBox x:Name="toursListBox" ItemTemplate="{StaticResource tourTemplate}" ItemsSource="{Binding tourCollection}" SelectionChanged="ListBox_SelectionChanged" Margin="-8,0,8,0"/>
		</Grid>
	</Grid>
</phone:PhoneApplicationPage>